#!/bin/bash

lastPid=`ps -ef | grep 'java -jar .*helloWorld' | grep -v '.*grep' | awk '{print $2}'`

if [ -n "$lastPid" ]

then
  echo "上一个已运行的pid是 $lastPid 现在需要将其停止"
  kill   $lastPid
fi
nohup java -jar ${WORKSPACE}/helloWorld/target/helloWorld-1.0-SNAPSHOT.jar &

exit 0


